package cn.guet.spider.ctrip;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import cn.guet.spider.ctrip.task.HotelTask;

/**
 * 携程数据爬虫启动类
 *
 * @author SAGITTAR
 */
@SpringBootApplication
public class TripApplication implements CommandLineRunner {

	@Autowired
	@Qualifier(value = "hotelTask")
	private HotelTask hotelTask;

	/**
	 * 这个方法为任务调度入口，需要再加进来，不需要就删掉或注释
	 *
	 * @param args
	 */
	@Override
	public void run(String... args) throws Exception {
		hotelTask.execute();
	}

	public static void main(String[] args) {
		SpringApplication.run(TripApplication.class, args);
	}
}
